package cn.tedu.boot4.controller;

import cn.tedu.boot4.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AxiosController {
    @RequestMapping("/helloAxios")
    public String helloAxios(String info){
        return "恭喜你,测试成功!"+info;
    }
    //当客户端发出异步的post请求,并且请求的参数为自定义对象时使用此注解
    @RequestMapping("/postAxios")
    public String postAxios(@RequestBody User user){
        return "post 也成功!"+user.toString();
    }
}
